import Vue from 'vue';
import Vuex from 'vuex';

import {user, UserState} from './module/User';
import {auth, AuthState} from '@/store/module/Auth';
import {device, DeviceState} from '@/store/module/Device';
import {info, InfoState} from '@/store/module/Info';
import {prePath, PrePathState} from '@/store/module/PrePath';

Vue.use(Vuex);

export interface StoreState {
  user: UserState,
  auth: AuthState,
  device: DeviceState,
  info: InfoState,
  prePath: PrePathState
}

export const store = new Vuex.Store<StoreState>({
  strict: process.env.NODE_ENV !== 'production',
  plugins: [],
  state: ({}) as StoreState,
  getters: {},
  mutations: {},
  actions: {},
  modules: {
    user,
    auth,
    device,
    info,
    prePath
  }
});
